package com.atguigu.gmall.mq.controller;

import com.atguigu.gmall.common.config.service.RabbitService;
import com.atguigu.gmall.common.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/mq")
public class MqController {

    @Autowired
    private RabbitService rabbitService;

    //编写发送消息的控制器
    @GetMapping("sendConfirm")
    public Result sendConfirm(){
        rabbitService.sendMessage("exchange.confirm","routing.confirm", "发送消息体");
        //返回数据
        return Result.ok();
    }
}
